package domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import type.EstadoType;
import dto.UserDTO;



@Entity
@Table(name="users")
public class User  implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	/**No se utiliza ningun metodo hash o de encriptacion*/
	
	@Enumerated(EnumType.STRING)
	private EstadoType estado;
	

	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="idUser")
	private Integer id;
	

	private String password; private String username;


	public User() {
		
	}


	public EstadoType getEstado() {
		return estado;
	}


	public Integer getId() {
		return id;
	}


	public String getPassword() {
		return password;
	}


	public String getUsername() {
		return username;
	}


	public UserDTO getVista(){
    	UserDTO dto = new UserDTO();
    	dto.setEstado(estado);
    	dto.setId(id);
    	dto.setPassword(password);
    	dto.setUsername(username);
    	return dto;
    }


	public void setEstado(EstadoType estado) {
		this.estado = estado;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public void setUsername(String username) {
		this.username = username;
	}

}
